<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图书管理</title>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/index.css">
    <script src="js/jquery.js"></script>
    <script src="js/index.js"></script>
    <script src="js/template-web.js"></script>
</head>

<body>

    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">图书管理</h3>
        </div>
        <div class="panel-body form-inline">

            <div class="input-group">
                <div class="input-group-addon">书名</div>
                <input type="text" class="form-control" id="bookname" name="bookname" placeholder="请输入书名">
            </div>
            <div class="input-group">
                <div class="input-group-addon">作者</div>
                <input type="text" class="form-control" id="author" name="author" placeholder="请输入作者">
            </div>
            <div class="input-group">
                <div class="input-group-addon">出版社</div>
                <input type="text" class="form-control" id="publisher" name="publisher" placeholder="请输入出版社">
            </div>
            <button type="button" class="btn btn-primary" id="addbtn">添加</button>
            <button type="button" class="btn btn-primary" id="querybtn">查询</button>
        </div>
    </div>


    <table class="table table-hover table-bordered" id="table">
        <thead>
            <tr>
                <th>
                    <input type="checkbox" class="a-checkbox"> 全选
                </th>
                <th>id</th>
                <th>书名</th>
                <th>作者</th>
                <th>出版社</th>
                <th>操作</th>

            </tr>
        </thead>
        <tbody id="booklist">
            <!-- <tr>
                <td></td>
            </tr> -->
        </tbody>
    </table>


    <div class="panel panel-primary">
        <div class="panel-body all">
            <input type="checkbox" class="a-checkbox">全选
            <a href="javascript:;" id="alldell">清除全部图书</a>
            <a href="javascript:;" id="checkdell">删除选中的图书</a>
        </div>
    </div>


    <script type="text/html" id="tpl">
        {{each data}}
        <tr>
            <td><input type="checkbox" class="j-checkbox"></td>
            <td class="id">{{$value.id}}</td>
            <td>{{$value.bookname}}</td>
            <td>{{$value.author}}</td>
            <td>{{$value.publisher}}</td>
            <td><a href="javascript:;" class="del">删除</a> |
                <a href="javascript:;" class="edit">修改</a>
            </td>
        </tr>
        {{/each}}

    </script>

</body>

</html>